import request from '@/utils/request'

const BAST_URL = '/system/user'

export default {
    // 列表分页
    getUserInfoList(page,limit,searchObj){
        return request({
            url:`${BAST_URL}/${page}/${limit}`,
            method: 'GET',
            params: searchObj
        })
    },
    
    //   根据id查找用户
    findUserById(id){
      return request({
          url:`${BAST_URL}/findUserById/${id}`,
          method:'post'
      })
  },
  // 添加用户
  addUser(user){
      return request({
          url:`${BAST_URL}/addUser`,
          method: 'post',
          data: user
      })
  },
  // 修改
  updateUser(user){
      return request({
          url:`${BAST_URL}/updateUserById`,
          method:'post',
          data: user
      })
  },
  // 根据id删除
  deleteUserById(id){
    return request({
        url:`${BAST_URL}/deleteById/${id}`,
        method:'delete'
    })
},
}